<?php
    $current_page   = $this->cur_page;
    $nr_of_pages    = $this->nr_of_pages;
    $base_url       = $this->base_url;
    $page_var       = $this->page_var;
    
    $previous       = (($current_page-1) < 1 ? 1 : $current_page-1);
    $next           = (($current_page+1) > $nr_of_pages ? $nr_of_pages : $current_page+1);
    
    $page_first     = 1;
    $page_last      = $nr_of_pages;
    
    if($nr_of_pages > 1)
    {
?>
<section class="pagination">
    <a href="<?php echo $base_url.$page_var.'/'.$page_first; ?>"<?php echo ($current_page == $page_first ? ' disabled="disabled"' : '')?>>&laquo;</a>
    <a href="<?php echo $base_url.$page_var.'/'.$previous; ?>"<?php echo ($current_page == $page_first ? ' disabled="disabled"' : '')?>>&lt;</a>
    <?php
        for($i=1; $i<=$nr_of_pages; $i++)
        {
            echo '<a href="'.$base_url.$page_var.'/'.$i.'"'.($i == $current_page ? ' class="current"' : '').'>'.$i.'</a> ';
        }
    ?>
    <a href="<?php echo $base_url.$page_var.'/'.$next; ?>"<?php echo ($current_page == $nr_of_pages ? ' disabled="disabled"' : '')?>>&gt;</a>
    <a href="<?php echo $base_url.$page_var.'/'.$page_last; ?>"<?php echo ($current_page == $nr_of_pages ? ' disabled="disabled"' : '')?>>&raquo;</a>
</section>
<?php
    }
?>